package com.wuzuqing.android.eightdiagrams;

import com.wuzuqing.android.eightdiagrams.model.CalculationTypeModel;

import java.util.ArrayList;
import java.util.List;

public class Test {

    public static void main(String[] args) {
        String value = "晴雨-11*升学-12*求学-13*取讨-14*招婿-15*命运-16*请医-17*考试-18*移居-21*会事-22*谋事-23*父母疾-24*房屋-25*分家-26*疾病-27*天花-28*求财-31*借财-32*购畜-33*开店-34*回乡-35*放帐-36*坟墓-37*赌钱-38*秋收-41*寻馆-42*求子-43*出行-44*取鱼-45*夜梦-46*入赘-47*口舌-48*脱货-51*见官-52*春蚕-53*解粮-54*起造-55*生意-56*文书-57*诉讼-58*升迁-61*寻人-62*纳监-63*和事-64*婚姻-65*怀孕-66*交易-67*取妾-68*田产-71*家信-72*买官-73*告状-74*买卖-75*求官-76*跟官-77*讨仆-78*寿命-81*家宅-82*合伙-83*失物-84*走失-85*行人-86*手艺-87*解人-88";
        String[] split = value.split("\\*");
        List<CalculationTypeModel> calculationTypeModels = new ArrayList<>();
        for (String s : split) {
            if (s == null) {
                continue;
            }
            String[] strings = s.split("-");
            if (strings.length == 2) {
                CalculationTypeModel calculationTypeModel = new CalculationTypeModel();
                calculationTypeModel.setId(strings[1]);
                calculationTypeModel.setName(strings[0]);
                calculationTypeModels.add(calculationTypeModel);
            }
        }
        System.out.println(calculationTypeModels.toString());
    }
}
